<extend name="Public/base"/>

<block name="body">
    <style>
        .form-item{ margin-top: 10px;}
        .form-item .item-label{ margin-top: 10px; font-size: 16px; font-weight: bold;}
        .form-item .controls{ margin-top: 5px;}
    </style>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    
    <?php foreach($teacherList as $val):?>
        <div class="form-item">
            <label class="item-label">问题：{$val['title']}</label>
            <div class="controls"> 答案：<?php echo $val['yes_no']==1 ? '是': '否';?> </div>
        </div>
    <?php endforeach;?>

</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav("{:U('Eval/index')}");
    </script>
    <script type="text/javascript">
        //上传图片
        /* 初始化上传插件 */
        $("#upload_picture_face").uploadify({
            "height": 30,
            "swf": "__STATIC__/uploadify/uploadify.swf",
            "fileObjName": "download",
            "buttonText": "上传图片",
            "uploader": "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
            "width": 120,
            'removeTimeout': 1,
            'fileTypeExts': '*.jpg; *.png; *.gif;',
            "onUploadSuccess": uploadPictureface,
            'onFallback': function () {
                alert('未检测到兼容版本的Flash.');
            }
        });
        function uploadPictureface(file, data) {
            var data = $.parseJSON(data);
            console.log(data);
            var src = '';
            if (data.status) {
                $("#cover_id_face").val(data.path);
                src = data.url || '__ROOT__' + data.path
                $("#cover_id_face").parent().find('.upload-img-box').html(
                        '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                        );
            } else {
                updateAlert(data.info);
                setTimeout(function () {
                    $('#top-alert').find('button').click();
                    $(that).removeClass('disabled').prop('disabled', false);
                }, 1500);
            }
        }
    </script>
</block>
